//
//  District.m
//  练习城市文件处理
//
//  Created by dllo on 16/7/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "District.h"

@implementation District
- (instancetype)initWithName:(NSString *)name {
    return [self initWithName:name number:nil];
}
+ (instancetype)areatWithName:(NSString *)name {
    return [[self alloc] initWithName:name number:nil];
}
- (NSString *)description {
    return [NSString stringWithFormat:@"name:%@ number:%@", _name, _number];
}
// 指派初始化方法
- (instancetype)initWithName:(NSString *)name number:(NSString*)number {
    self = [super init];
    if (self) {
        _name = name;
        _number = number;
    }
    return self;
}
+ (instancetype)areatWithName:(NSString *)name number:(NSString *)number {
    return [[self alloc] initWithName:name number:number];
}

- (instancetype)initWithTempCity:(TempCIty *)tempCity {
    return [self initWithName:tempCity.cityName number:tempCity.cityNumber];

}
+ (instancetype)tempCityWithTempCity:(TempCIty *)tempCity {
    return [[self alloc] initWithName:tempCity.cityName number:tempCity.cityNumber];
}
@end
